# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yofi
pkgver=0.1.5
pkgrel=0
pkgdesc="A minimalistic menu for wayland"
url="https://github.com/l4l/yofi"
arch="aarch64 armhf armv7 ppc64le x86 x86_64"  # blocked by rust/cargo
license="MIT"
makedepends="
	cargo
	fontconfig-dev
	freetype-dev
	wayland-dev
	"
source="https://github.com/l4l/yofi/archive/$pkgver/yofi-$pkgver.tar.gz
	remove-systemd-logger.patch
	minimize-size.patch
	"

# font-fontkit loads fonts via system libraries.
_cargo_opts="--frozen --no-default-features --features=font-fontkit"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 target/release/yofi -t "$pkgdir"/usr/bin/
}

sha512sums="
5c18fb9e1dd1c5b101b9676fff180fe64cd206d06fa7dc6a1a84fec5dbe13f30f7da101ca5cb8ee38acc6439b8d21f96baa7c1d60705f20abd3c67fac779a112  yofi-0.1.5.tar.gz
455d9f8845e968f1445dd0dca636fb7ff19876d3a964ff85ad039b0c6a4cf13e326b1e1e59cb4f0e857c3301700e2591002051d400b03020d1049d9abd296297  remove-systemd-logger.patch
b804606fe784c6d42b4b0c9236f80c0badd727ba906c828dad39c5b4073d1aff2db97bfb35927260fbe00be42e31e579204a8f4a626ea6ba62fb4082ac5a1807  minimize-size.patch
"
